Skip to content

fix: Skylighting code blocks in Typst lack proper block styling#14131

Open
gordonwoodhull wants to merge 1 commit intomainfrom
bugfix/14126
Open

fix: Skylighting code blocks in Typst lack proper block styling#14131
gordonwoodhull wants to merge 1 commit intomainfrom
bugfix/14126

Conversation

@gordonwoodhull
Copy link
Contributor

@gordonwoodhull gordonwoodhull commented Feb 27, 2026

Summary

  • Override the Pandoc-generated #let Skylighting() Typst function to add width: 100%, inset: 8pt, and radius: 2pt to the block() call, matching native code block styling
  • Also fixes brand monospace-block.background-color not applying to Skylighting output (since #show raw.where(block: true) doesn't match #Skylighting() calls)
  • This is a temporary workaround until the fix can be upstreamed to the Skylighting library

Fixes #14126

Test plan

  • 8 new smoke-all tests covering default, line numbers, brand bgcolor, brand without bgcolor, brand inline, brand+theme, brand+idiomatic, brand inheritance
  • 5 pre-existing syntax-highlighting tests still pass
  • Visual inspection of rendered Typst PDFs with code blocks

Fixes #14126

The Pandoc-generated Skylighting function uses `block(fill: bgcolor, blocks)`
which lacks width, inset, and radius. This temporarily overrides it from the
typst-brand-yaml Lua filter to add `width: 100%`, `inset: 8pt`, `radius: 2pt`,
matching the styling of native code blocks.

Also fixes brand `monospace-block.background-color` not applying to Skylighting
output (since `#show raw.where(block: true)` doesn't match `#Skylighting()` calls).

This override will be removed once the fix is upstreamed to Skylighting.
@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Feb 27, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code blocks in Typst with Skylighting do not have full width background or padding

2 participants